//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================

#include "PktFileChunkAck.h"
#include <VxUtilLib/vx_debug.h>
#include <string.h>

PktFileChunkAck::PktFileChunkAck()
{
    m_u16PktType = PKT_TYPE_FILE_CHUNK_ACK;
    m_u16PktLen = sizeof( PktFileChunkAck );
    u16Res = 0;
    u32Error = 0;
    u32CurOffs = 0;
    as8Arg1[ 0 ] = 0;
    vx_assert( 0 == (m_u16PktLen & 0x0f ) );
}

void PktFileChunkAck::CalcPktLen( void )
{
    //calculate length of packet from length of file data
    m_u16PktLen = (unsigned short)ROUND_TO_16BYTE_BOUNDRY( sizeof( PktFileChunkAck ) - MAX_PKT_ERR_MSG_LEN  + strlen( as8Arg1 )+1 );
}



